<template>
      <div class="chart" id="onechart" style="width: 800px;height: 500px;margin: -30px auto;"></div>
  </template>
  
    
<script>
import * as echarts from "echarts";
export default {
    mounted() {
        // 获取容器元素
        const chartContainer = document.getElementById("onechart");
        // 初始化 ECharts 实例
        const myChart = echarts.init(chartContainer);
         // 设置图表的配置项和数据
        const option = {
        series: [
                {
                    type: "pie",
                    radius: [40, 90],
                    
                    itemStyle: {
                        borderRadius: 7
                    },
          
                    data: [{
                        name: "可借馆总量",
                        value: 435132
                    },
                    {
                        name: "外借馆总量",
                        value: 521571
                    },
                    {
                        name: "读者总量",
                        value: 841133
                    },
                    {
                        name: "馆数总量",
                        value: 632112,
                        
                    },
                
                    ],
                    

                }
            ]
 };
 // 将配置项应用到图表实例上
 myChart.setOption(option);
},
    };

</script>
    
<style lang='less'>

</style>
